package au.com.centrumsystems.hudson.plugin.buildpipeline;

import java.util.List;

public class CellForm<T extends CellForm> {

    private final List<T> dependencies;

    public CellForm(List<T> dependencies) {
        this.dependencies = dependencies;
    }

    public List<T> getDependencies() {
        return this.dependencies;
    }

    public int getMaxDependencies() {
        int depth = getDependencies().size();
        for (T dependency : getDependencies()) {
            depth = Math.max(depth, dependency.getMaxDependencies());
        }
        return depth;
    }
}

